#include "mymath.h"
#include "mystdio.h"
#include <string.h>
#include <unistd.h>
#include <stdio.h>

int main()
{
   MYFILE* fp = my_fopen("log.txt", "w");
   if(fp == NULL)
   {
       return 1;
   }

   char data[128];
   const char* s = "hello wusaqi";
   int count = 20;
   while(count--)
   {
       snprintf(data, sizeof(data), "%s:%d\n", s, count);
       my_fwrite(data, strlen(data), fp);
       sleep(1);
   }

   my_fclose(fp);

    return 0;
}
